//
//  QSUserAccount.h
//  SinaWeiBo
//
//  Created by apple on 16/6/1.
//  Copyright © 2016年 apple. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface QSUserAccount : NSObject
/**
 *  用户授权的唯一票据(令牌)
 */
@property (nonatomic, copy) NSString* access_token;

/**
 *  	access_token的生命周期，单位是秒数
 */
@property (nonatomic, assign) NSTimeInterval expires_in;

/**
 *  access_token的过期日期
 */
@property (nonatomic, strong) NSDate* expires_date;

/**
 *  授权用户的UID，本字段只是为了方便开发者
 */
@property (nonatomic, copy) NSString* uid;

/**
 *  用户头像地址
 */
@property (nonatomic, copy) NSString* avatar_large;

/**
 *  用户名称
 */
@property (nonatomic, copy) NSString* name;

// 字典转模型
- (instancetype)initWithDict:(NSDictionary *)dict;
+ (instancetype)userAccountWithDict:(NSDictionary *)dict;

/**
 *  归档
 */
- (void)saveAccount;

/**
 *  解归档
 */
- (QSUserAccount *)loadAccount;

/**
 *  单例
 */
singleton_interface(QSUserAccount)
@end
